<div class = "main-view"><!--最外层div-->
    <div class="left-margin top-margin"><strong class="am-text-primary am-text-lg">总佣金>大使佣金一览</strong></div>
    <script>

        var fromDate = $('#startDateSelect').datepicker().on('changeDate', function (ev) {
            $scope.startDateSelect = ev.date.format('yyyy-MM-dd');
            $("#startDateSelect").val(ev.date.format('yyyy-MM-dd'));
        });

        var toDate = $('#endDateSelect').datepicker().on('changeDate', function (ev) {
            $scope.endDateSelect = ev.date.format('yyyy-MM-dd');
            $("#endDateSelect").val(ev.date.format('yyyy-MM-dd'));
        });
    </script>
    <form class="am-form-inline left-margin top-margin" role="form">
        <div class="am-form-group">
            <label class="left-margin">下单日期:</label>
            <input type="text" id="startDateSelect" ng-model="start" class="modal-input" size="16" data-date-format="yyyy-mm-dd">
            <!--<label class="left-margin">结束日期：</label>
            <input type="text" id="endDateSelect"  ng-model="end" class="modal-input" size="16" data-date-format="yyyy-mm-dd">-->
            <label class="left-margin">手机号:</label> <input type="text" class="am-form-field" ng-model="option.phone">
            <label class="left-margin">昵称:</label> <input type="text" class="am-form-field" ng-model="option.nickName">
        </div>
        <button id="search-target" data-am-modal="{target: '#loading'}" type="submit" class="am-btn am-btn-primary left-margin" ng-click="search()" data-target="cascad-search">搜索</button>
        <!--<button id="export-target"   type="submit" class="am-btn am-btn-primary left-margin" ng-click="exportdata()">导出</button>-->
        <div class="top-margin">
            <button type="button" class="am-btn am-btn-default" ng-click="exportdata()"><span class="am-icon-download"></span> 导出</button>
            <button type="button" class="am-btn am-btn-default" onclick="history.back()">返回</button>
        </div>
    </form>
    <br>

    <div id = "pagination" class = "pagination"></div>
    <div class="pagination-table left-margin" id="tab_menu" style = "margin-top: 0px;">
        <form class="am-form">
            <table class="am-table-striped am-table-hover table-main">
                <thead>
                <tr>
                    <th class="table-title">下单日期</th>
                    <th class="table-title">大使昵称</th>
                    <th class="table-title">大使手机号</th>
                    <th class="table-title">总佣金</th>
                    <th class="table-title">分享订单佣金</th>
                    <th class="table-title">自购订单佣金</th>
                    <th class="table-title">小区订单佣金</th>
                    <th class="table-title">被邀请大使订单佣金</th>
                    <th class="table-title">总订单数</th>
                    <th class="table-title">已成团订单数</th>
                    <th class="table-title">未成团订单数</th>
                    <th class="table-title">已退款订单数</th>
                    <th class="table-title">分享订单数</th>
                    <th class="table-title">自购订单数</th>
                    <th class="table-title">小区订单数</th>
                    <th class="table-title">被邀请大使订单数</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="ambCommObj in ambCommDayList" id = "{{ambCommObj.ambUserId}}">
                    <td>{{ambCommObj.orderDate}}</td>
                    <td>{{ambCommObj.ambNickName}}</td>
                    <td>{{ambCommObj.ambMobilePhone}}</td>
                    <td>{{ambCommObj.totalCommission}}</td>
                    <td>{{ambCommObj.shareCommission}}</td>
                    <td>{{ambCommObj.selfPurComm}}</td>
                    <td>{{ambCommObj.communityComm}}</td>
                    <td>{{ambCommObj.invitedComm}}</td>
                    <td>
                        <a ng-href="#/commissionOrderDetail?userId={{ambCommObj.ambUserId}}&orderTime={{ambCommObj.orderDate}}">{{ambCommObj.totalOrders}}</a>
                    </td>
                    <td>{{ambCommObj.groupOrders}}</td>
                    <td>{{ambCommObj.unGroupOrders}}</td>
                    <td>{{ambCommObj.refundOrders}}</td>
                    <td>{{ambCommObj.shareOrders}}</td>
                    <td>{{ambCommObj.selfPurOrders}}</td>
                    <td>{{ambCommObj.communityOrders}}</td>
                    <td>{{ambCommObj.invitedAmbOrders}}</td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>

    <div class = "left-margin">共<span id = 'page_number'>{{pageNumber}}</span>页 <span>{{count}}条数据</span></div>
    <div class="alert" style="background: black;opacity: 0.2;position: fixed;top: 0;left: 0;right: 0;bottom:0;display: none ">
        <div class="mian" style="width: 50px;height: 200px;color: white;margin: 20% auto"><img src="../../img/jiazai.gif"></div>
    </div>
</div>